﻿using System;
using System.Linq;
using MartinRL.ProjectEuler.Sequences;

namespace MartinRL.ProjectEuler
{
    /// <summary>
    /// http://projecteuler.net/index.php?section=problems&id=10
    /// </summary>
    public static class Problem010
    {
        public static long FindTheSumOfAllThePrimesBelowTwoMillion()
        {
            return new LongPrimeSequence().AsParallel()
                .TakeWhile(prime => prime < 2000000)
                .Sum();
        }
    }
}